import Vue from 'vue'
import VueRouter from 'vue-router'
import createRouter from './router/router'
import Vuex from 'vuex'
import createStore from './store/store'

import App from './App.vue'

import './assets/style/base/base.scss'
// 自定义组件插件
import AppGlobal from './plugins/component/index.js'
// 自定义全局指令
import AppDirectives from './plugins/directive/index.js'
// 自定义过滤器
import filters from './plugins/filters/index.js'

// 全局
import global_ from './util/global'
Vue.use(VueRouter)
Vue.use(Vuex)
Vue.use(global_)
Vue.use(AppGlobal)
Vue.use(AppDirectives)

const router = createRouter()
const store = createStore()

Object.keys(filters).forEach(key => Vue.filter(key, filters[key]))
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
